﻿using System.Collections.Generic;
using Microsoft.Xna.Framework;
using GameLibrary;
using Rescue_of_the_Dwarvenzombies.SceneLayers;
using Rescue_of_the_Dwarvenzombies.SceneObjects.GameObjects;

namespace Rescue_of_the_Dwarvenzombies.GameStates
{
    /// <summary>
    /// The abstract class that different GameStates, such as PlayingState and PauseState, inherit.
    /// </summary>
    /// <remarks></remarks>
    internal abstract class GameState
    {
        protected Game Game;

        protected GameStateManager GameStateManager;

        /// <summary>
        /// List of GUI objects.
        /// </summary>
        /// <returns></returns>
        /// <remarks></remarks>
        public abstract List<GameObject> GUIObjects();

        /// <summary>
        /// Gets or sets the root layer.
        /// </summary>
        /// <value>The root layer.</value>
        /// <remarks></remarks>
        public ISceneLayer RootLayer { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="GameState"/> class.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <remarks></remarks>
        protected GameState(Game game)
        {
            Game = game;
        }

        /// <summary>
        /// Updates the specified game time.
        /// </summary>
        /// <param name="gameTime">The game time.</param>
        /// <remarks></remarks>
        public abstract void Update(GameTime gameTime);

        /// <summary>
        /// Inits the root layer.
        /// </summary>
        /// <remarks></remarks>
        protected abstract void InitRootLayer();

        /// <summary>
        /// Determines whether [has state changed].
        /// </summary>
        /// <returns><c>true</c> if [has state changed]; otherwise, <c>false</c>.</returns>
        /// <remarks></remarks>
        protected abstract bool HasStateChanged();
    }
}